package edu.hcmiu.portal.model.impl;

import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.portal.model.impl.BaseModelImpl;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl;

import edu.hcmiu.portal.model.hook_taglist;
import edu.hcmiu.portal.model.hook_taglistSoap;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.List;


/**
 * <a href="hook_taglistModelImpl.java.html"><b><i>View Source</i></b></a>
 *
 * <p>
 * ServiceBuilder generated this class. Modifications in this class will be
 * overwritten the next time is generated.
 * </p>
 *
 * <p>
 * This class is a model that represents the <code>hook_taglist</code> table
 * in the database.
 * </p>
 *
 * @author Brian Wing Shun Chan
 *
 * @see edu.hcmiu.portal.model.hook_taglist
 * @see edu.hcmiu.portal.model.hook_taglistModel
 * @see edu.hcmiu.portal.model.impl.hook_taglistImpl
 *
 */
public class hook_taglistModelImpl extends BaseModelImpl<hook_taglist> {
    public static final String TABLE_NAME = "hook_taglist";
    public static final Object[][] TABLE_COLUMNS = {
            { "taglistID", new Integer(Types.BIGINT) },
            

            { "taglistName", new Integer(Types.VARCHAR) }
        };
    public static final String TABLE_SQL_CREATE = "create table hook_taglist (taglistID LONG not null primary key,taglistName VARCHAR(75) null)";
    public static final String TABLE_SQL_DROP = "drop table hook_taglist";
    public static final String DATA_SOURCE = "liferayDataSource";
    public static final String SESSION_FACTORY = "liferaySessionFactory";
    public static final String TX_MANAGER = "liferayTransactionManager";
    public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
                "value.object.entity.cache.enabled.edu.hcmiu.portal.model.hook_taglist"),
            true);
    public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
                "value.object.finder.cache.enabled.edu.hcmiu.portal.model.hook_taglist"),
            true);
    public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
                "lock.expiration.time.edu.hcmiu.portal.model.hook_taglist"));
    private long _taglistID;
    private String _taglistName;
    private transient ExpandoBridge _expandoBridge;

    public hook_taglistModelImpl() {
    }

    public static hook_taglist toModel(hook_taglistSoap soapModel) {
        hook_taglist model = new hook_taglistImpl();

        model.setTaglistID(soapModel.getTaglistID());
        model.setTaglistName(soapModel.getTaglistName());

        return model;
    }

    public static List<hook_taglist> toModels(hook_taglistSoap[] soapModels) {
        List<hook_taglist> models = new ArrayList<hook_taglist>(soapModels.length);

        for (hook_taglistSoap soapModel : soapModels) {
            models.add(toModel(soapModel));
        }

        return models;
    }

    public long getPrimaryKey() {
        return _taglistID;
    }

    public void setPrimaryKey(long pk) {
        setTaglistID(pk);
    }

    public Serializable getPrimaryKeyObj() {
        return new Long(_taglistID);
    }

    public long getTaglistID() {
        return _taglistID;
    }

    public void setTaglistID(long taglistID) {
        _taglistID = taglistID;
    }

    public String getTaglistName() {
        return GetterUtil.getString(_taglistName);
    }

    public void setTaglistName(String taglistName) {
        _taglistName = taglistName;
    }

    public hook_taglist toEscapedModel() {
        if (isEscapedModel()) {
            return (hook_taglist) this;
        } else {
            hook_taglist model = new hook_taglistImpl();

            model.setNew(isNew());
            model.setEscapedModel(true);

            model.setTaglistID(getTaglistID());
            model.setTaglistName(HtmlUtil.escape(getTaglistName()));

            model = (hook_taglist) Proxy.newProxyInstance(hook_taglist.class.getClassLoader(),
                    new Class[] { hook_taglist.class },
                    new ReadOnlyBeanHandler(model));

            return model;
        }
    }

    public ExpandoBridge getExpandoBridge() {
        if (_expandoBridge == null) {
            _expandoBridge = new ExpandoBridgeImpl(hook_taglist.class.getName(),
                    getPrimaryKey());
        }

        return _expandoBridge;
    }

    public Object clone() {
        hook_taglistImpl clone = new hook_taglistImpl();

        clone.setTaglistID(getTaglistID());
        clone.setTaglistName(getTaglistName());

        return clone;
    }

    public int compareTo(hook_taglist hook_taglist) {
        long pk = hook_taglist.getPrimaryKey();

        if (getPrimaryKey() < pk) {
            return -1;
        } else if (getPrimaryKey() > pk) {
            return 1;
        } else {
            return 0;
        }
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        hook_taglist hook_taglist = null;

        try {
            hook_taglist = (hook_taglist) obj;
        } catch (ClassCastException cce) {
            return false;
        }

        long pk = hook_taglist.getPrimaryKey();

        if (getPrimaryKey() == pk) {
            return true;
        } else {
            return false;
        }
    }

    public int hashCode() {
        return (int) getPrimaryKey();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append("{taglistID=");
        sb.append(getTaglistID());
        sb.append(", taglistName=");
        sb.append(getTaglistName());
        sb.append("}");

        return sb.toString();
    }

    public String toXmlString() {
        StringBuilder sb = new StringBuilder();

        sb.append("<model><model-name>");
        sb.append("edu.hcmiu.portal.model.hook_taglist");
        sb.append("</model-name>");

        sb.append(
            "<column><column-name>taglistID</column-name><column-value><![CDATA[");
        sb.append(getTaglistID());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>taglistName</column-name><column-value><![CDATA[");
        sb.append(getTaglistName());
        sb.append("]]></column-value></column>");

        sb.append("</model>");

        return sb.toString();
    }
}
